// ==========================================================================
// 生成人：JasonLaw
// ==========================================================================
package CrmRepairOrderModel

import (
	"github.com/gogf/gf/frame/g"
	"github.com/gogf/gf/os/gtime"
)

// Entity is the golang structure for table crmRepairOrder.
type Entity struct {
	Id         uint        `orm:"id,primary" json:"id"`         // ID
	CreateTime *gtime.Time `orm:"createTime" json:"createTime"` // 创建时间
	UpdateTime *gtime.Time `orm:"updateTime" json:"updateTime"` // 更新时间
	Title      string      `orm:"title" json:"title"`           // 工单标题
	Detail     string      `orm:"detail" json:"detail"`         // 问题详情
	Solution   string      `orm:"solution" json:"solution"`     // 解决方案
	Status     int         `orm:"status" json:"status"`         // 状态#1:待处理,5:处理中,10:已完成#
	CrmUserId  int         `orm:"crmUserId" json:"crmUserId"`   // 用户ID
}

var (
	// Table is the table name of crmRepairOrder.
	Table = "crm_repair_order"
	M     = g.DB("default").Model(Table).Safe()
)

/**
{
    "keyWord": "商品标题", // 模糊搜索，搜索的字段对应keyWordLikeFields
    "types": 1, // 全等于筛选，对应fieldEq
    "page": 2, // 第几页
    "size": 1, // 每页返回个数
    "sort": "desc", // 排序方向
    "order": "id" // 排序字段
	"startTime": "2021-08-02 00:00:00",//用创建时间判断
    "endTime": "2021-09-30 23:59:59",//用创建时间判断
	"isExport": true,//是否是都出excel
}
*/
//分页请求参数
type PageReqParams struct {
	KeyWord   string `p:"keyWord"`
	Page      int    `p:"page" default:"1"`
	Size      int    `p:"size" default:"20"`
	Status    int    `p:"status" default:"-1"`
	Order     string `p:"order"`
	Sort      string `p:"sort"`
	IsExport  bool   `p:"isExport"`
	StartTime string `p:"startTime"`
	EndTime   string `p:"endTime"`
}
type AddReqParams struct {
	Title     string `p:"title" v:"required#工单标题不能为空"`
	Detail    string `p:"detail" v:"required#问题详情不能为空"`
	Solution  string `p:"solution" `
	Status    int    `p:"status" v:"required#状态#1:待处理,5:处理中,10:已完成#不能为空"`
	CrmUserId int    `p:"crmUserId" v:"required#用户ID不能为空"`
}
type UpdateReqParams struct {
	Id        uint   `p:"id" v:"required#ID不能为空"`
	Title     string `p:"title" `
	Detail    string `p:"detail" `
	Solution  string `p:"solution" `
	Status    int    `p:"status" `
	CrmUserId int    `p:"crmUserId" `
}
type InfoReqParams struct {
	Id int `p:"id" v:"required#id不能为空"`
}
type ListReqParams struct {
	Title  string `p:"title" `
	Status int    `p:"status"  default:"-1"`
}
type DeleteReqParams struct {
	Ids []int `p:"ids" v:"required#ids不能为空"`
}
